Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
問題描述
在任何情況下,無論地區詞轉換選擇如何,都有
实时→即時。例:fcitx5-android 在繁體狀態下無法打出
實時。分析
STPhrases.txt 中有
实时→即時的轉換。OpenCC/data/dictionary/STPhrases.txt
Line 18635 in 46ebc38
這個錯誤的轉換在 #826 被引入。但 STPhrases.txt 不應該包括地區詞轉換,否則會導致異常。
解決方案
從 STPhrases.txt 移除該轉換。
參考了 Wikipedia 的公共轉換組,只在 IT 轉換組中找到了規則
Item('real-time', '实时=>zh-tw:即时; 实时=>zh-hk:即时; 实时=>zh-mo:即时;');考慮到該詞的轉換並非在任何情況下都適用,故僅在 TWPhrasesIT.txt 中對應添加轉換。後續
寫了一個 Python 腳本,基於 pypinyin 庫檢查 STPhrases.txt 中是否有其他錯誤的情況。
pinyincheck.py
目測結果均爲假陽性。
運氣就是這麼好。